package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class MainActivity14 extends AppCompatActivity {
    Button btn_return;
    private TextView textView,textView5,textView6;
    //private ImageView img;
    ImageView img;
    String   value2,value3;
    int k;
    int[] imgs = new int[]{
            R.drawable.touxiang1,
            R.drawable.touxiang2
    };
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main14);
        initView();
        btnMain();
    }
    private void initView() {
        textView=findViewById(R.id.textView14);
        textView5=findViewById(R.id.textView15);
        textView6=findViewById(R.id.textView22);
        img=findViewById(R.id.imageView_avatar);
        Intent intent = getIntent();
        String value = intent.getStringExtra("name");
        value2 =intent.getStringExtra("pwd");
        value3 =intent.getStringExtra("school");
        k=intent.getIntExtra("image",0);
        textView.setText(value);
        textView5.setText(value2);
        textView6.setText(value3);
        img.setBackgroundResource(imgs[k]);
        btn_return=findViewById(R.id.button_Main);
    }
    private void btnMain() {
        btn_return.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent1 = new Intent(MainActivity14.this,MainActivity.class);
                startActivity(intent1);
                finish();
            }
        });
    }
}